<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>

<xsl:template match="text()"/>	
	
	<xsl:template match="compras">
		<transacoes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../schemas/transacoes.xsd"><xsl:attribute name="cnpj"><xsl:value-of select="./cnpj/text()"></xsl:value-of></xsl:attribute><xsl:apply-templates/></transacoes>
	</xsl:template>
	
	<xsl:template match="compra">
		<transacao><xsl:apply-templates/></transacao>
	</xsl:template>
	
	<xsl:template match="produto">
		<item>
			<quant><xsl:value-of select="./../quantidade/text()"/></quant>
			<valor_unit><xsl:value-of select="./../valor/text()"/></valor_unit>
		</item>
	</xsl:template>
	
	<xsl:template match="data">
		<data><xsl:value-of select="text()"/></data>
		<cartao><xsl:value-of select="../../cartao/text()"/></cartao>
	</xsl:template>
	
</xsl:stylesheet>